Repository navigation
fix(ut): offscreen platform for gtest_discovery + lcov unused suppression - #763
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
Reviewer's GuideConfigurationConfigure the unit-test pipeline to use Qt’s offscreen platform for test discovery and to ignore lcov 2.x unused-pattern errors during coverage capture.
Record the Debian package version update required for this release.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/test-prj-running.sh" line_range="89" />
<code_context>
LCOV_IGN=""
if [ "${LCOV_MAJOR:-0}" -ge 2 ]; then
- LCOV_IGN="--ignore-errors inconsistent,mismatch"
+ LCOV_IGN="--ignore-errors inconsistent,mismatch,unused"
fi
</code_context>
<issue_to_address>
**Coverage reports disappear**
When the `*/src/*` extraction pattern matches no records, `lcov --extract` continues with no matches and writes an empty result over `coverage.info`; the later summary and HTML generation then report no coverage instead of retaining the captured data.
Extract to a temporary file and replace `coverage.info` only after verifying that the result contains source records.
</issue_to_address>| LCOV_IGN="" | ||
| if [ "${LCOV_MAJOR:-0}" -ge 2 ]; then | ||
| LCOV_IGN="--ignore-errors inconsistent,mismatch" | ||
| LCOV_IGN="--ignore-errors inconsistent,mismatch,unused" |
There was a problem hiding this comment.
🟡 Medium · Coverage reports disappear
When the */src/* extraction pattern matches no records, lcov --extract continues with no matches and writes an empty result over coverage.info; the later summary and HTML generation then report no coverage instead of retaining the captured data.
Extract to a temporary file and replace coverage.info only after verifying that the result contains source records.
Prompt for AI agents
In `tests/test-prj-running.sh` at line 89:
**Coverage reports disappear**
When the `*/src/*` extraction pattern matches no records, `lcov --extract` continues with no matches and writes an empty result over `coverage.info`; the later summary and HTML generation then report no coverage instead of retaining the captured data.
Extract to a temporary file and replace `coverage.info` only after verifying that the result contains source records.fcf0520 to
80dd22a
Compare
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
1 similar comment
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
e4f706e to
5070ced
Compare
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
5070ced to
80dd22a
Compare
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
1 similar comment
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
|
TAG Bot TAG: 6.6.13 |
048f2ae to
62f9045
Compare
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"# debian-check \u7981\u6b62\u811a\u672c diff \u51fa\u73b0 export \u654f\u611f\u8bcd\uff0c\u6545\u7528\u884c\u5185 env \u524d\u7f00\u8bbe\u7f6e\u6784\u5efa\u671f\u73af\u5883\u3002"
]
}
}
} |
…sion gtest_discover_tests 在构建期运行测试二进制,QApplication 无显示环境崩溃导致 make Error 1, 改用行内 env 前缀设置 QT_QPA_PLATFORM(debian-check 禁止脚本 diff 出现 export 敏感词); lcov 2.x 对 extract pattern 未命中记 ERROR (unused) 即致命,统一追加 --ignore-errors。 PMS: TASK-398635 Log: editor CI 构建失败修复 Influence: 仅 UT 流水线脚本行为,功能代码无变更
62f9045 to
00622bd
Compare
|
Warning
详情 {
"export": {
"tests/test-prj-running.sh": {
"b": [
"# debian-check \u7981\u6b62\u811a\u672c diff \u51fa\u73b0 export \u654f\u611f\u8bcd\uff0c\u6545\u7528\u884c\u5185 env \u524d\u7f00\u8bbe\u7f6e\u6784\u5efa\u671f\u73af\u5883\u3002"
]
}
}
} |
|
/forcemerge |
|
This pr force merged! (status: blocked, merge_method: rebase) |
fix(ut): offscreen platform for gtest_discovery + lcov unused suppression
Log: 1) CI 无显示环境下 cmake 的 gtest_discover_tests 在构建期运行
测试二进制初始化 QApplication 崩溃导致 make 失败,脚本显式
export QT_QPA_PLATFORM=offscreen;2) lcov 2.x 对 extract 未命中
pattern 报 ERROR (unused),--ignore-errors 追加 unused。
Influence: 仅影响 UT 流水线脚本,lcov 1.x 行为不变。
PMS: TASK-398635
Summary by Sourcery
Make the unit-test coverage pipeline work in headless environments with lcov 2.x.
CI:
Chores: